﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<script language="c#" runat="server">
protected string GetNamespace(object instanceID)
{
	return Manager.Instances.Select(Alias.Instance.ID + "='" + instanceID + "'")[0][Alias.Module.Namespace].ToString();
}
</script>
<section data-page="rewrite_add" data-title="添加重写">
	<dl class="path1">
		<dt><span>您的位置：</span><a href="list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">网址重写</a> → <b>添加</b></dt>
	</dl>
	<form action="" class="post">
		<div class="post-body">
			<table class="post-table margin2">
				<tr>
					<th>需重写的地址：</th>
					<td><input name="LookFor" size="60" class="ali-input"> 格式为正则表达式。必须以http://或者~/开头。系统会全字匹配，即前面会加上^，结尾会加上$。</td>
				</tr>
				<tr>
					<th>用户代理：</th>
					<td><input name="UserAgent" size="60" class="ali-input"> 格式为正则表达式</td>
				</tr>
				<tr>
					<th>重定向方式：</th>
					<td>
						<label><input type="radio" name="Type" value="Address" checked>网址</label>
						<label><input type="radio" name="Type" value="Instance">实例</label>
						<label><input type="radio" name="Type" value="Exception">例外</label>
					</td>
				</tr>
				<tr data-name="SendTo">
					<th>重定向的地址：</th>
					<td><input name="SendTo" size="60" class="ali-input"><br>可以获取重写地址中的组值，格式为：(组名)</td>
				</tr>
				<tr data-name="Is301">
					<th>301转向：</th>
					<td><label><input type="checkbox" name="Is301" >301转向</label></td>
				</tr>
				<tr data-name="InstanceID" style="display:none">
					<th>实例：</th>
					<td>
						<select name="InstanceID" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
							<option value="">--未指定--</option>
							<ali:List Object="Instance">
								<ali:Record>
									<option value="<%=ID%>" data-namespace="<%=GetNamespace(ID)%>"><%=Name%></option>
								</ali:Record>
							</ali:List>
						</select>
					</td>
				</tr>
				<tr data-name="ObjectFullName" style="display:none">
					<th>对象：</th>
					<td><select name="ObjectFullName" data-ali-widget="combo"><option value="">--未指定--</option></select></td>
				</tr>
				<tr data-name="Operation" style="display:none">
					<th>操作：</th>
					<td><select name="Operation" data-ali-widget="combo"><option value="">--未指定--</option></select></td>
				</tr>
				<tr data-name="Lang" style="display:none">
					<th>语言：</th>
					<td>
						<select name="Lang" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
							<ali:List Mark="System" Object="Language">
								<ali:Record>
									<option value="<%=Ab%>"><%=Name%></option>
								</ali:Record>
							</ali:List>
						</select>
					</td>
				</tr>
			</table>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">添 加</button></div>
	</form>
</section>